< previous page page_559 next page >

Page 559
    Message As String
    Buttons As Variant
    Title As String
    HelpFile As String
    HelpID As Long
    Return As Long
End Type
'
Public udtErrDialog As errDialog

'
' declare winHelp API
Declare Function WinHelp Lib "user32" Alias "WinHelpA" (ByVal hwnd As Long, _
  ByVal lpHelpFile As String, _
  ByVal wCommand As Long, _
  ByVal dwData As Long) As Long
'
Public Const HELP_CONTEXT = &H1
Public Const HELP_QUIT = &H2
That's all that you need to add to the modErrHandler. Next, you need to add code to the Initialize event of the errHandler Class module. Add the code from Listing 14.15 to the Class_Initialize event.
Type.gifListing 14.15. Adding code to the Class_Initialize event of the errHandler class.
Private Sub Class_Initialize()
    '
    ' set starting values
    errDefRtn = errExit
    errDefType = errItem
    '
    udtErrDialog.Buttons = ""
    udtErrDialog.HelpFile = ""
    udtErrDialog.HelpID = -1
    udtErrDialog.Message = ""
    udtErrDialog.Return = -1
    udtErrDialog.Title = ""
    '
End Sub
This errHandler class has two Public propertiesthe DefaultAction and DefaultType properties. These defaults were set in the Initialize event and can be overridden by setting the properties at runtime. Create the DefaultAction property (using the Tools | Add Procedure menu option) and add the code from Listing 14.16 into the Property Let and Property Get routines.

 
< previous page page_559 next page >

If you like this book, buy it!